home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / scsh / scsh-interfaces.scm < prev    next >
Text File  |  1995-10-31  |  20KB  |  972 lines

  1. ;;; The module interfaces for scsh.
  2. ;;; Copyright (c) 1994 by Olin Shivers and David Albertz.
  3. ;;; Copyright (c) 1994 by Brian D. Carlstrom
  4.  
  5. (define-interface posix-fdflags-interface
  6.   (export open/read
  7.       open/write
  8.       open/read+write
  9.       open/nonblocking
  10.       open/append
  11.       open/no-control-tty
  12.       open/create
  13.       open/truncate
  14.       open/exclusive
  15.       open/access-mask
  16.  
  17.       fcntl/close-on-exec
  18.       fcntl/dupfd
  19.       fcntl/get-fd-flags
  20.       fcntl/set-fd-flags
  21.       fcntl/get-file-flags
  22.       fcntl/set-file-flags
  23.       fcntl/get-record-lock
  24.       fcntl/set-record-lock
  25.       fcntl/set-record-lock-noblock
  26.  
  27.       lock/read
  28.       lock/write
  29.       lock/release))
  30.  
  31. (define-interface posix-errno-interface
  32.   (export errno/2big
  33.       errno/acces
  34.       errno/again
  35.       errno/badf
  36.       errno/busy
  37.       errno/child
  38.       errno/deadlk
  39.       errno/dom
  40.       errno/exist
  41.       errno/fault
  42.       errno/fbig
  43.       errno/intr
  44.       errno/inval
  45.       errno/io
  46.       errno/isdir
  47.       errno/mfile
  48.       errno/mlink
  49.       errno/nametoolong
  50.       errno/nfile
  51.       errno/nodev
  52.       errno/noent
  53.       errno/noexec
  54.       errno/nolck
  55.       errno/nomem
  56.       errno/nospc
  57.       errno/nosys
  58.       errno/notdir
  59.       errno/notempty
  60.       errno/notty
  61.       errno/nxio
  62.       errno/perm
  63.       errno/pipe
  64.       errno/range
  65.       errno/rofs
  66.       errno/spipe
  67.       errno/srch
  68.       errno/xdev))
  69.  
  70.  
  71. (define-interface posix-signals-interface
  72.   (export signal/abrt
  73.       signal/alrm
  74.       signal/chld
  75.       signal/cont
  76.       signal/fpe
  77.       signal/hup
  78.       signal/ill
  79.       signal/int
  80.       signal/kill
  81.       signal/pipe
  82.       signal/quit
  83.       signal/segv
  84.       signal/stop
  85.       signal/term
  86.       signal/tstp
  87.       signal/ttin
  88.       signal/ttou
  89.       signal/usr1
  90.       signal/usr2))
  91.  
  92. (define-interface scsh-errors-interface
  93.   (export errno-error
  94.       error
  95.       with-errno-handler*
  96.       (with-errno-handler :syntax)))
  97.  
  98.  
  99.  
  100. (define buffered-io-flags-interface
  101.   (export bufpol/block
  102.       bufpol/line
  103.       bufpol/none))
  104.  
  105. (define-interface scsh-io-interface
  106.   (compound-interface buffered-io-flags-interface
  107.               (export close
  108.                   close-after
  109.                   error-output-port
  110.                   dup
  111.                   dup->inport
  112.                   dup->outport
  113.                   dup->fdes
  114.                   open-file
  115.  
  116.                   force-output
  117.                   set-port-buffering
  118.                   bufpol/block
  119.                   bufpol/line
  120.                   bufpol/none
  121.  
  122.                   seek
  123.                   tell
  124.                   seek/set
  125.                   seek/delta
  126.                   seek/end
  127.  
  128.                   select
  129.                   select!
  130.  
  131.                   flush-all-ports
  132.                   y-or-n?
  133.                   *y-or-n-eof-count*
  134.                   ;; R4RS I/O procedures that scsh provides.
  135.                   write
  136.                   char-ready?
  137.                   read-char
  138.                   write-char
  139.                   display
  140.                   newline
  141.                   input-port?
  142.                   output-port?
  143.                   call-with-input-file
  144.                   call-with-output-file
  145.                   with-input-from-file
  146.                   with-output-to-file
  147.                   open-input-file
  148.                   open-output-file
  149.                   format
  150.  
  151.                   lock-region?
  152.                   lock-region:exclusive?
  153.                   lock-region:whence
  154.                   lock-region:start
  155.                   lock-region:len
  156.                   lock-region:pid
  157.                   make-lock-region
  158.  
  159.                   lock-region
  160.                   lock-region/no-block
  161.                   get-lock-region
  162.                   unlock-region
  163.                   with-region-lock*
  164.                   (with-region-lock :syntax)
  165.  
  166.                   fork-pty-session
  167.                   open-pty
  168.                   pty-name->tty-name
  169.                   tty-name->pty-name
  170.                   make-pty-generator
  171.  
  172.                   with-current-input-port*
  173.                   (with-current-input-port :syntax)
  174.                   with-current-output-port*
  175.                   (with-current-output-port :syntax)
  176.                   with-error-output-port*
  177.                   (with-error-output-port :syntax)
  178.                   set-current-input-port!
  179.                   set-current-output-port!
  180.                   set-error-output-port!
  181.  
  182.                   stdports->stdio
  183.                   stdio->stdports
  184.                   with-stdio-ports*
  185.                   (with-stdio-ports :syntax)
  186.  
  187.                   call/fdes
  188.                   release-port-handle
  189.                   port-revealed
  190.                   fdes->inport
  191.                   fdes->outport
  192.                   move->fdes
  193.                   open-fdes
  194.                   pipe
  195.                   port->string
  196.                   port->sexp-list
  197.                   port->string-list
  198.                   port->list
  199.                   reduce-port
  200.                   port->fdes
  201.                   read-string
  202.                   read-string!
  203.                   read-string/partial
  204.                   read-string!/partial
  205.                   write-string
  206.                   write-string/partial)))
  207.  
  208.  
  209. (define-interface scsh-file-interface
  210.   (export create-directory
  211.       create-fifo
  212.       create-hard-link
  213.       create-symlink
  214.  
  215.       delete-directory
  216.       delete-file
  217.       delete-filesys-object
  218.       rename-file
  219.       set-file-mode
  220.       set-file-owner
  221.       set-file-group
  222.       set-file-times
  223.       truncate-file
  224.  
  225.       read-symlink            ; Not POSIX.
  226.  
  227.       file-attributes        ; Deprecated;
  228.       file-info            ; preferred.
  229.  
  230.       file-info:type
  231.       file-info:device
  232.       file-info:inode
  233.       file-info:mode
  234.       file-info:nlinks
  235.       file-info:uid
  236.       file-info:gid
  237.       file-info:size
  238.       file-info:atime
  239.       file-info:mtime
  240.       file-info:ctime
  241.       file-type
  242.       file-group
  243.       file-inode
  244.       file-last-access
  245.       file-last-mod
  246.       file-last-status-change
  247.       file-mode
  248.       file-nlinks
  249.       file-owner
  250.       file-size
  251.       file-symlink?
  252.       file-directory?
  253.       file-fifo?
  254.       file-regular?
  255.       file-socket?
  256.       file-special?
  257.       file-not-readable?
  258.       file-not-writable?
  259.       file-not-writeable?    ; Deprecated
  260.       file-not-executable?
  261.       file-readable?
  262.       file-writeable?
  263.       file-writable?    ; Deprecated
  264.       file-executable?
  265.       file-not-exists?
  266.       file-exists?
  267.  
  268.       sync-file
  269.       sync-file-system
  270.  
  271.       directory-files
  272.       glob
  273.       glob-quote
  274.       file-match
  275.  
  276.       create-temp-file
  277.       temp-file-iterate
  278.       temp-file-channel
  279.       *temp-file-template*))
  280.  
  281.  
  282. (define-interface scsh-process-interface
  283.   (export exec
  284.       exec-path
  285.       exec/env
  286.       exec-path/env
  287.       %exec
  288.       exec-path-search
  289.  
  290.       exit
  291.       %exit
  292.  
  293.       suspend
  294.  
  295.       fork
  296.       %fork
  297.  
  298.       proc?
  299.       proc:pid
  300.       pid->proc
  301.  
  302.       autoreap-policy
  303.       reap-zombies
  304.       
  305.       wait
  306.       wait-any
  307.       wait-process-group
  308.  
  309.       status:exit-val
  310.       status:stop-sig
  311.       status:term-sig
  312.       wait/poll
  313.       wait/stopped-children
  314.  
  315.       call-terminally
  316.       halts?))
  317.  
  318.  
  319. (define-interface scsh-process-state-interface
  320.   (export umask
  321.       set-umask
  322.       with-umask*
  323.       (with-umask :syntax)
  324.  
  325.       chdir
  326.       cwd
  327.       with-cwd*
  328.       (with-cwd :syntax)
  329.  
  330.       pid
  331.       parent-pid
  332.       process-group
  333.       set-process-group
  334.       become-session-leader
  335.  
  336.       user-login-name
  337.       user-uid
  338.       user-effective-uid
  339.       user-gid
  340.       user-effective-gid
  341.       user-supplementary-gids
  342.       set-uid
  343.       set-gid
  344.  
  345.       system-name
  346.       process-times
  347.       cpu-ticks/sec))
  348.  
  349.  
  350. (define-interface scsh-user/group-db-interface
  351.   (export user-info
  352.       user-info:name
  353.       user-info:uid
  354.       user-info:gid
  355.       user-info:home-dir
  356.       user-info:shell
  357.  
  358.       ->uid
  359.       ->username
  360.  
  361.       group-info
  362.       group-info:name
  363.       group-info:gid
  364.       group-info:members
  365.  
  366.       ->gid
  367.       ->groupname))
  368.  
  369.  
  370. (define-interface scsh-command-line-interface
  371.   (export command-line-arguments
  372.       command-line
  373.       arg
  374.       arg*
  375.       argv))
  376.  
  377.  
  378. (define-interface scsh-signals-interface
  379.   (export signal-process
  380.       signal-process-group
  381.       pause-until-interrupt
  382.       sleep
  383.       itimer))
  384.  
  385.  
  386. (define-interface scsh-environment-interface
  387.   (export setenv
  388.       getenv
  389.       env->alist
  390.       alist->env
  391.       alist-delete
  392.       alist-update
  393.       alist-compress
  394.       with-env*
  395.       with-total-env*
  396.       (with-env :syntax)
  397.       (with-total-env :syntax)
  398.       add-before
  399.       add-after))
  400.  
  401.  
  402. (define-interface scsh-home-interface
  403.   (export home-directory
  404.       exec-path-list))
  405.  
  406.  
  407. (define-interface scsh-regexp-interface
  408.   (export string-match
  409.       regexp-match?
  410.       match:start
  411.       match:end
  412.       match:substring
  413.       make-regexp
  414.       regexp?
  415.       regexp-exec
  416.       regexp-quote))
  417.  
  418.  
  419. (define-interface scsh-string-interface
  420.   (compound-interface (export substitute-env-vars
  421.                   index
  422.                   rindex)
  423.               scsh-regexp-interface))
  424.  
  425.  
  426. (define-interface scsh-file-names-interface
  427.   (export file-name-as-directory
  428.       file-name-directory?
  429.       file-name-non-directory?
  430.       directory-as-file-name
  431.       file-name-absolute?
  432.       file-name-directory
  433.       file-name-nondirectory
  434.       split-file-name
  435.       path-list->file-name
  436.       file-name-extension
  437.       file-name-sans-extension
  438.       replace-extension
  439.       parse-file-name
  440.       expand-file-name
  441.       simplify-file-name
  442.       resolve-tilde-file-name
  443.       resolve-file-name
  444.       home-dir
  445.       home-file))
  446.  
  447.  
  448. (define-interface scsh-time-interface
  449.   (export make-date
  450.       date?
  451.  
  452.       date:seconds
  453.       date:minute    
  454.       date:hour       
  455.       date:month-day    
  456.       date:month       
  457.       date:year        
  458.       date:tz-name    
  459.       date:tz-secs    
  460.       date:summer?    
  461.       date:week-day    
  462.       date:year-day
  463.  
  464.       set-date:seconds
  465.       set-date:minute    
  466.       set-date:hour       
  467.       set-date:month-day    
  468.       set-date:month       
  469.       set-date:year        
  470.       set-date:tz-name    
  471.       set-date:tz-secs    
  472.       set-date:summer?    
  473.       set-date:week-day    
  474.       set-date:year-day
  475.  
  476.       time+ticks
  477.       ticks/sec
  478.       time
  479.       date
  480.       date->string
  481.       format-date))
  482.       
  483.  
  484. (define-interface scsh-misc-interface
  485.   (export (receive :syntax)
  486.  
  487.       arithmetic-shift
  488.       bitwise-and
  489.       bitwise-ior
  490.       bitwise-not
  491.       bitwise-xor))
  492.  
  493.  
  494. (define-interface scsh-high-level-process-interface
  495.   (export (run :syntax)
  496.       (exec-epf :syntax)
  497.       (& :syntax)
  498.       (||          :syntax)
  499. ;      (:or:           :syntax)    ; Alternate R4RS syntax for ||.
  500.       (&&             :syntax)
  501.       (run/collecting :syntax)
  502.       (run/port+proc  :syntax)
  503.       (run/port       :syntax)
  504.       (run/strings    :syntax)
  505.       (run/file       :syntax)
  506.       (run/string     :syntax)
  507.       (run/sexp       :syntax)
  508.       (run/sexps      :syntax)
  509.  
  510.       fork/pipe
  511.       %fork/pipe
  512.       fork/pipe+
  513.       %fork/pipe+
  514.       tail-pipe
  515.       tail-pipe+
  516.       run/collecting*
  517.       run/port+proc*
  518.       run/port*
  519.       run/file*
  520.       run/string*
  521.       run/sexp*
  522.       run/sexps*
  523.       run/strings*
  524.  
  525.       char-filter
  526.       string-filter))
  527.  
  528.  
  529. (define-interface scsh-version-interface
  530.   (export scsh-major-version
  531.       scsh-minor-version
  532.       scsh-version-string))
  533.  
  534.  
  535. ;;; This is probably bogus.
  536. (define-interface string-ports-interface
  537.   (export make-string-input-port
  538.           call-with-string-output-port
  539.       make-string-output-port
  540.       string-output-port-output))
  541.  
  542.  
  543. (define-interface scsh-utilities-interface
  544.   (export del delete index rindex reduce filter first any first? nth
  545.       any? every? mapv mapv! vector-every? copy-vector
  546.       optional-arg optional-arg* parse-optionals
  547.       check-arg conjoin disjoin negate compose reverse! call/cc
  548.       deprecated-proc
  549.       deposit-bit-field
  550.       real->exact-integer))
  551.  
  552. ;;; semi-standard network magic numbers
  553. ;;; should be available on all platforms
  554. ;;; if not, tell us, and we'll move it
  555. ;;; to the os-dependent directory
  556.  
  557. ;;; for now, all socket option magic numbers
  558. ;;; are considered machine dependent until
  559. ;;; there is a standard or a clear portable subset
  560.  
  561. (define-interface sockets-network-interface
  562.   (export shutdown/receives
  563.       shutdown/sends
  564.       shutdown/sends+receives
  565.       herror/host-not-found
  566.       herror/try-again
  567.       herror/no-recovery
  568.       herror/no-data
  569.       herror/no-address
  570.       address-family/unspecified
  571.       address-family/unix
  572.       address-family/internet
  573.       socket-type/stream
  574.       socket-type/datagram
  575.       socket-type/raw
  576.       ;;socket-type/rdm
  577.       ;;socket-type/seqpacket
  578.       protocol-family/unspecified
  579.       protocol-family/unix
  580.       protocol-family/internet
  581.       internet-address/any
  582.       internet-address/loopback
  583.       internet-address/broadcast
  584.       message/out-of-band
  585.       message/peek
  586.       message/dont-route
  587.       level/socket
  588.       options/boolean
  589.       options/value
  590.       options/linger
  591.       options/timeout))
  592.  
  593. ;;; actual functions interface
  594. (define-interface scsh-sockets-interface
  595.   (export socket-connect
  596.       bind-listen-accept-loop
  597.       socket?
  598.       socket:family
  599.       socket:inport
  600.       socket:outport
  601.       socket-address?   
  602.       socket-address:family
  603.       internet-address->socket-address
  604.       socket-address->internet-address
  605.       unix-address->socket-address
  606.       socket-address->unix-address
  607.       create-socket
  608.       close-socket
  609.       bind-socket
  610.       connect-socket
  611.       listen-socket
  612.       accept-connection
  613.       socket-remote-address
  614.       socket-local-address
  615.       shutdown-socket
  616.       create-socket-pair
  617.       receive-message
  618.       receive-message!
  619.       receive-message/partial
  620.       receive-message!/partial
  621.       send-message
  622.       send-message/partial
  623.       socket-option
  624.       set-socket-option
  625.  
  626.       host-info
  627.       host-info?
  628.       host-info:name
  629.       host-info:aliases
  630.       host-info:addresses
  631.       network-info
  632.       network-info?
  633.       network-info:name
  634.       network-info:aliases
  635.       network-info:net
  636.       service-info
  637.       service-info?
  638.       service-info:name
  639.       service-info:aliases
  640.       service-info:port
  641.       service-info:protocol
  642.       protocol-info
  643.       protocol-info?
  644.       protocol-info:name
  645.       protocol-info:aliases
  646.       protocol-info:number
  647.       
  648.       net-to-host-32
  649.       net-to-host-16
  650.       host-to-net-32
  651.       host-to-net-16
  652.       ))
  653.  
  654.  
  655. (define-interface char-set-interface
  656.   (export char:newline char:tab char:linefeed char:page char:return char:space
  657.       char-ascii?
  658.       char-set?
  659.  
  660.       char-set
  661.       chars->char-set
  662.       string->char-set
  663.       ascii-range->char-set
  664.       predicate->char-set
  665.       ->char-set
  666.  
  667.       char-set-members
  668.       char-set-contains?
  669.  
  670.       char-set-invert
  671.       char-set-union
  672.       char-set-intersection
  673.       char-set-difference
  674.  
  675.       char-set:upper-case
  676.       char-set:lower-case
  677.       char-set:numeric
  678.       char-set:whitespace
  679.       char-set:not-whitespace
  680.       char-set:alphabetic
  681.       char-set:alphanumeric
  682.       char-set:graphic
  683.  
  684.       char-upper-case?
  685.       char-lower-case?
  686.       char-numeric?
  687.       char-whitespace?
  688.       char-alphabetic?
  689.       char-alphanumeric?
  690.       char-graphic?))
  691.  
  692.  
  693. (define-interface scsh-field-reader-interface
  694.   (export join-strings
  695.       field-splitter infix-splitter suffix-splitter sloppy-suffix-splitter
  696.       record-reader
  697.       field-reader
  698.       nth))        ; Kinda handy.
  699.  
  700. (define-interface scsh-delimited-readers-interface
  701.   (export read-line
  702.       read-paragraph
  703.       read-delimited read-delimited!
  704.       %read-delimited!
  705.       skip-char-set))
  706.  
  707. (define-interface awk-interface
  708.   (export (awk :syntax)))
  709.  
  710. (define-interface scsh-dbm-interface
  711.   (export dbm-open
  712.       dbm-close
  713.       dbm-delete
  714.       dbm-fetch
  715.       dbm-insert
  716.       dbm-replace
  717.       dbm-firstkey
  718.       dbm-nextkey
  719.       dbm-record?
  720.       dbm-record:open?
  721.       btree/method
  722.       btree-info:flags
  723.       btree-info:cachesize
  724.       btree-info:maxkeypage
  725.       btree-info:minkeypage
  726.       btree-info:psize
  727.       btree-info:lorder
  728.       btree-info?
  729.       make-btree-info
  730.       hash/method
  731.       hash-info:bsize
  732.       hash-info:ffactor
  733.       hash-info:nelem
  734.       hash-info:cachesize
  735.       hash-info:lorder
  736.       hash-info?
  737.       make-hash-info
  738.       recno/method
  739.       recno-info:flags
  740.       recno-info:cachesize
  741.       recno-info:psize
  742.       recno-info:lorder
  743.       recno-info:reclen
  744.       recno-info:bval
  745.       recno-info:bfname
  746.       recno-info?
  747.       make-recno-info))
  748.  
  749. ;;; Magic flags for SCSH-TTY-INTERFACE.
  750. (define-interface tty-flags-interface
  751.   (export
  752.           ;; Indices into the control char string
  753.       ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  754.           ;; Posix
  755.           ttychar/eof
  756.       ttychar/eol
  757.       ttychar/delete-char
  758.       ttychar/delete-line
  759.       ttychar/interrupt
  760.       ttychar/quit
  761.       ttychar/suspend
  762.       ttychar/start
  763.       ttychar/stop
  764.       ttychar/min
  765.       ttychar/time
  766.       
  767.       ;; SVR4 & 4.3+BSD
  768.       ttychar/delete-word
  769.       ttychar/reprint
  770.       ttychar/literal-next
  771.       ttychar/discard
  772.       ttychar/delayed-suspend
  773.       ttychar/eol2
  774.  
  775.       ;; 4.3+BSD
  776.       ttychar/status
  777.  
  778.       disable-tty-char
  779.  
  780.       ;; Input flag bits
  781.       ;;;;;;;;;;;;;;;;;;
  782.       ;; Posix
  783.       ttyin/ignore-break
  784.       ttyin/interrupt-on-break
  785.       ttyin/ignore-bad-parity-chars
  786.       ttyin/mark-parity-errors
  787.       ttyin/check-parity
  788.       ttyin/7bits
  789.       ttyin/nl->cr
  790.       ttyin/ignore-cr
  791.       ttyin/cr->nl
  792.       ttyin/output-flow-ctl
  793.       ttyin/input-flow-ctl
  794.  
  795.       ;; SVR4 & 4.3+BSD
  796.       ttyin/xon-any
  797.       ttyin/beep-on-overflow
  798.  
  799.       ;; SVR4
  800.       ttyin/lowercase
  801.  
  802.       ;; Output flag bits
  803.       ;;;;;;;;;;;;;;;;;;;
  804.       ttyout/enable            ; opost: enable output processing
  805.  
  806.       ;; SVR4 & 4.3+BSD
  807.       ttyout/nl->crnl        ; onlcr: map nl to cr-nl
  808.  
  809.       ;; 4.3+BSD
  810.       ttyout/discard-eot        ; onoeot
  811.       ttyout/expand-tabs        ; oxtabs (NOT xtabs)
  812.  
  813.       ;; SVR4
  814.       ttyout/cr->nl            ; ocrnl
  815.       ttyout/fill-w/del        ; ofdel
  816.       ttyout/delay-w/fill-char    ; ofill
  817.       ttyout/uppercase        ; olcuc
  818.       ttyout/nl-does-cr        ; onlret
  819.       ttyout/no-col0-cr        ; onocr
  820.  
  821.       ;; Newline delay
  822.       ttyout/nl-delay        ; mask (nldly)
  823.       ttyout/nl-delay0        
  824.       ttyout/nl-delay1        ; tty 37 
  825.  
  826.       ;; Horizontal-tab delay
  827.       ttyout/tab-delay        ; mask (tabdly)
  828.       ttyout/tab-delay0        
  829.       ttyout/tab-delay1        ; tty 37 
  830.       ttyout/tab-delay2        
  831.       ttyout/tab-delayx        ; Expand tabs (xtabs, tab3)
  832.  
  833.       ;; Carriage-return delay
  834.       ttyout/cr-delay        ; mask (crdly)
  835.       ttyout/cr-delay0        
  836.       ttyout/cr-delay1        ; tn 300 
  837.       ttyout/cr-delay2        ; tty 37 
  838.       ttyout/cr-delay3        ; concept 100 
  839.  
  840.       ;; Vertical tab delay 
  841.       ttyout/vtab-delay        ; mask (vtdly)
  842.       ttyout/vtab-delay0        
  843.       ttyout/vtab-delay1        ; tty 37 
  844.  
  845.       ;; Backspace delay
  846.       ttyout/bs-delay        ; mask (bsdly)
  847.       ttyout/bs-delay0        
  848.       ttyout/bs-delay1        
  849.  
  850.       ;; Form-feed delay
  851.       ttyout/ff-delay        ; mask (ffdly)    
  852.       ttyout/ff-delay0        
  853.       ttyout/ff-delay1        
  854.  
  855.       ttyout/all-delay
  856.  
  857.  
  858.       ;; Control flag bits
  859.       ;;;;;;;;;;;;;;;;;;;;
  860.       ;; Posix
  861.       ttyc/char-size        ; csize: character size mask 
  862.       ttyc/char-size5        ; 5 bits (cs5)
  863.       ttyc/char-size6        ; 6 bits (cs6)
  864.       ttyc/char-size7        ; 7 bits (cs7)
  865.       ttyc/char-size8        ; 8 bits (cs8)
  866.       ttyc/2-stop-bits        ; cstopb: Send 2 stop bits.
  867.       ttyc/enable-read        ; cread: Enable receiver.
  868.       ttyc/enable-parity        ; parenb
  869.       ttyc/odd-parity        ; parodd
  870.       ttyc/hup-on-close        ; hupcl: Hang up on last close.
  871.       ttyc/no-modem-sync        ; clocal: Ignore modem lines.
  872.  
  873.       ;;  4.3+BSD
  874.       ttyc/ignore-flags        ; cignore: ignore control flags 
  875.       ttyc/CTS-output-flow-ctl    ; ccts_oflow: CTS flow control of output
  876.       ttyc/RTS-input-flow-ctl    ; crts_iflow: RTS flow control of input
  877.       ttyc/carrier-flow-ctl        ; mdmbuf
  878.  
  879.       ;; Local flag bits
  880.       ;;;;;;;;;;;;;;;;;;
  881.       ;; POSIX
  882.       ttyl/visual-delete        ; echoe: Visually erase chars
  883.       ttyl/echo-delete-line        ; echok: Echo nl after line kill
  884.       ttyl/echo            ; echo:  Enable echoing
  885.       ttyl/echo-nl            ; echonl: Echo nl even if echo is off
  886.       ttyl/canonical        ; icanon: Canonicalize input
  887.       ttyl/enable-signals        ; isig: Enable ^c, ^z signalling
  888.       ttyl/extended            ; iexten:  Enable extensions
  889.       ttyl/ttou-signal        ; tostop: SIGTTOU on background output
  890.       ttyl/no-flush-on-interrupt    ; noflsh
  891.  
  892.       ;; SVR4 & 4.3+BSD
  893.       ttyl/visual-delete-line    ; echoke: visually erase a line-kill 
  894.       ttyl/hardcopy-delete        ; echoprt: visual erase for hardcopy 
  895.       ttyl/echo-ctl            ; echoctl: echo control chars as "^X" 
  896.       ttyl/flush-output        ; flusho: output is being flushed
  897.       ttyl/reprint-unread-chars    ; pendin: retype pending input
  898.  
  899.       ;; 4.3+BSD
  900.       ttyl/alt-delete-word        ; altwerase
  901.       ttyl/no-kernel-status        ; nokerninfo: no kernel status on ^T
  902.  
  903.       ;; SVR4
  904.       ttyl/case-map            ; xcase: canonical upper/lower presentation
  905.       ))
  906.  
  907. ;;; Non-exported values required by the tty code.
  908. (define-interface scsh-internal-tty-flags-interface
  909.   (export baud-rates
  910.       num-ttychars
  911.  
  912.       ;; tcflush() constants
  913.       %flush-tty/input        ; TCIFLUSH
  914.       %flush-tty/output        ; TCOFLUSH
  915.       %flush-tty/both        ; TCIOFLUSH
  916.  
  917.       ;; tcflow() constants
  918.       %tcflow/start-out        ; TCOON
  919.       %tcflow/stop-out        ; TCOOFF
  920.       %tcflow/start-in        ; TCION
  921.       %tcflow/stop-in        ; TCIOFF
  922.  
  923.       ;; tcsetattr() constants
  924.       %set-tty-info/now        ; TCSANOW   Make change immediately.
  925.       %set-tty-info/drain        ; TCSADRAIN Drain output, then change.
  926.       %set-tty-info/flush        ; TCSAFLUSH Drain output, flush input.
  927.       ))
  928.  
  929.  
  930. ;;; POSIX termios tty control.
  931. (define-interface tty-interface
  932.   (compound-interface
  933.       tty-flags-interface
  934.       (export 
  935.          ;; The tty-info record
  936.       tty-info?            type/tty-info
  937.       tty-info:control-chars    set-tty-info:control-chars
  938.       tty-info:input-flags        set-tty-info:input-flags 
  939.       tty-info:output-flags        set-tty-info:output-flags  
  940.       tty-info:control-flags    set-tty-info:control-flags
  941.       tty-info:local-flags        set-tty-info:local-flags
  942.       tty-info:input-speed        set-tty-info:input-speed
  943.       tty-info:output-speed        set-tty-info:output-speed
  944.       tty-info:min            set-tty-info:min
  945.       tty-info:time            set-tty-info:time
  946.  
  947.       make-tty-info            copy-tty-info
  948.  
  949.       tty-info
  950.       set-tty-info/now
  951.       set-tty-info/drain
  952.       set-tty-info/flush
  953.  
  954.       send-tty-break
  955.       drain-tty
  956.       flush-tty/input
  957.       flush-tty/output
  958.       flush-tty/both
  959.  
  960.       start-tty-output
  961.       stop-tty-output
  962.       start-tty-input
  963.       stop-tty-input
  964.  
  965.       encode-baud-rate
  966.       decode-baud-rate
  967.  
  968.       open-control-tty
  969.       set-tty-process-group
  970.       tty-process-group
  971.       )))
  972.